# Author: michael folkerts (http://bit.ly/folkerts)

CC = g++

bin2jpg: 
	Magick++-config --cxxflags --cppflags --ldflags --libs > temp.txt
	cat temp.txt | xargs g++ -I/usr/include -Wall -ansi -L/usr/lib bin2jpg.cpp -largtable2 -o bin2jpg 
	rm temp.txt

install:
	mkdir -p ~/bin
	PWD=`pwd`
	ln -sf $(PWD)/bin2jpg ~/bin/bin2jpg
	#NOTICE: You may have to log out then back in again if you didn't previously have a ~/bin folder

clean:
	rm -rf *o bin2jpg
	rm -rf ~/bin/bin2jpg


failsafe:
	g++ `Magick++-config --cxxflags --cppflags` -Wall -ansi -largtable2 -o bin2jpg bin2jpg.cpp `Magick++-config --ldflags --libs`
